package com.example.backend.Mapper;

import com.example.backend.entity.Document;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DocumentMapper {
    @Select("select * from document where fileName=#{fileName}")
    Document isCovered(String fileName);
//    插入数据
    @Insert("insert into document(fileName,curcontent) values(#{fileName},#{curcontent})")
    Integer insertDocument(String fileName, String curcontent);
//    更新
    @Update("update document set curcontent=#{curcontent} where fileName=#{fileName}")
    Integer cover(String fileName, String curcontent);
//    删除
    @Delete("delete from document where fileName=#{fileName}")
    Integer del(String fileName);
    //    显示所有
    @Select("select * from document")
    List<Document> search();
}
